import Mock from 'mockjs'
import menu from './data/menu.js'
import orderList from './data/orderList'
Mock.mock('/menu', 'post', {menu});
Mock.mock('/orderList', 'post', function (options) {
  console.log(options)
  let page = JSON.parse(options.body).page
  let limit = JSON.parse(options.body).limit

  let first = (page - 1) * limit
  let last = page * limit

  let data = {}
  console.log(orderList)
  console.log(first)
  console.log(limit)
  data.list = orderList.list.slice(first, last)
  data.total = orderList.total
  console.log(data)

  return {tableData: data}
})